package com.cbtx.module_sp.bean;

import java.io.Serializable;
import java.util.List;

/**
 * author : joker.peng
 * e-mail : joker@fiture.com
 * date   : 2021/6/10 5:48 PM
 * desc   :
 */
public class UpgradeInfoEntity implements Serializable {


    /**
     * code : 0
     * msg : 操作成功
     * logMsg : null
     * data : {"sysDate":1623378496997,"pollConfig":
     * [{"pollConfigId":null,"pollName":"REPORT","pollIntervalTime":300000},
     * {"pollConfigId":null,"pollName":"NEW_SETTING","pollIntervalTime":7200000},
     * {"pollConfigId":null,"pollName":"NEW_PROGRAM","pollIntervalTime":3600000},
     * {"pollConfigId":null,"pollName":"NEW_UPGRADE","pollIntervalTime":7200000}],
     * "newChange":{"newSetting":null,"newSettingUpdateTime":null,"newUpgrade":null,
     * "newUpgradeUpdateTime":null,"newProgram":true,"newProgramUpdateTime":1620617351524,
     * "newBottomAd":null,"newBottomAdUpdateTime":null,"newFaceBackgroundUpload":null}}
     */

    private int code;
    private String msg;
    private Object logMsg;
    private List<UpgradeInfo> data;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getLogMsg() {
        return logMsg;
    }

    public void setLogMsg(Object logMsg) {
        this.logMsg = logMsg;
    }

    public List<UpgradeInfo> getData() {
        return data;
    }

    public void setData(List<UpgradeInfo> data) {
        this.data = data;
    }

    public static class UpgradeInfo implements Serializable {
        /**
         * isTiming : 0
         * md5 : string
         * size : string
         * timingTime : 0
         * upgradeName : string
         * upgradeType : 0
         * url : string
         * versionCode : 0
         * versionName : string
         */

        private String isTiming;
        private String md5;
        private String size;
        private String timingTime;
        private String upgradeName;
        private String upgradeType;//0软件，1固件
        private String url;
        private String versionCode;
        private String versionName;

        public int getIsTiming() {
            try {
                return Integer.parseInt(isTiming);
            } catch (Exception e) {
                return 0;
            }
        }

        public void setIsTiming(String isTiming) {
            this.isTiming = isTiming;
        }

        public String getMd5() {
            return md5;
        }

        public void setMd5(String md5) {
            this.md5 = md5;
        }

        public String getSize() {
            return size;
        }

        public void setSize(String size) {
            this.size = size;
        }

        public int getTimingTime() {
            try {
                return Integer.parseInt(timingTime);
            } catch (Exception e) {
                return 0;
            }
        }

        public void setTimingTime(String timingTime) {
            this.timingTime = timingTime;
        }

        public String getUpgradeName() {
            return upgradeName;
        }

        public void setUpgradeName(String upgradeName) {
            this.upgradeName = upgradeName;
        }

        public int getUpgradeType() {
            try {
                return Integer.parseInt(upgradeType);
            } catch (Exception e) {
                return -1;
            }
        }

        public void setUpgradeType(String upgradeType) {
            this.upgradeType = upgradeType;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public int getVersionCode() {
            try {
                return Integer.parseInt(versionCode);
            } catch (Exception e) {
                return 0;
            }
        }

        public void setVersionCode(String versionCode) {
            this.versionCode = versionCode;
        }

        public String getVersionName() {
            return versionName;
        }

        public void setVersionName(String versionName) {
            this.versionName = versionName;
        }
    }
}